import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '@/view/Main'
import User from '@/view/User'
import Home from '@/view/home'
import Mall from '@/view/mall'
import PageOne from '@/view/other/PageOne'
import PageTwo from '@/view/other/PageTwo'
import Login from '@/view/Login/Login'
Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Main',
    component: Main,
    redirect: '/home',
    children: [{
        path: '/home',
        name: 'home',
        component: Home
    }, {
        path: '/user',
        name: 'user',
        component: User
    }, {
        path: '/mall',
        name: 'mall',
        component: Mall
    }, {
        path: '/page1',
        name: 'page1',
        component: PageOne
    }, {
        path: '/page2',
        name: 'page2',
        component: PageTwo
    }]
}, {
    path: '/login',
    name: 'login',
    component: Login
}]
const router = new VueRouter({
    // mode: history,
    routes
})
export default router